import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
import { IsNotEmpty, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

@Entity()
export class Organi {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  @IsNotEmpty({ message: '企业名称不能为空' })
  @ApiProperty({ default: 'admin', description: '机构名称' })
  orgname: string;

  @Column()
  @IsNotEmpty({ message: '联系方式不能为空' })
  @IsString({ message: '联系方式必须为字符串' })
  @ApiProperty({ default: '91820332', description: '电话' })
  tel: string;

  @Column()
  @IsNotEmpty({ message: '邮箱不能为空' })
  @ApiProperty({ default: '91820332@163.com', description: '邮箱' })
  email: string;

  @Column()
  @IsNotEmpty({ message: '法人不能为空' })
  @ApiProperty({ default: '科技公司', description: '企业性质' })
  entity: string;

  @Column()
  @IsNotEmpty({ message: '注册资本不能为空' })
  @ApiProperty({ default: '5000w', description: '注册资本' })
  registeredCapital: string;

  @Column()
  @IsNotEmpty({ message: '地址不能为空' })
  @ApiProperty({ default: '石家庄长安区', description: '地址' })
  address: string;
}
